#pragma once

#include <windows.h>

/** 
 * \ingroup ti6
 *
 * \brief
 * Window is an abstract class used to dispatch windows messages directly to the
 * instance which manages the window (for which the message is sent). Note that
 * a window is defined as an object which receives windows messages. It can be
 * an application window, but it can also be a button, edit field etc.
 *
 * Copyright (c) Academie voor ICT en Media 2007 - 2008
 */
class Window
{
public:
	/**
	 \brief
	 Handle messages, specific for this window.
	 
	 \param uMsg The message id.
	 \param wParam 32 bits value, specific to the message.
	 \param lParam 32 bits value, specific to the message.
	 \return The result of the processing, which is dependent on the type of message.
	 */
	virtual LRESULT handleMessage( UINT uMsg, WPARAM wParam, LPARAM lParam ) = 0;

	/**
	 \brief
	 Dispatch Win32 messages to the correct Window instance.
	 
	 \param hWnd The window handle.
	 \param uMsg The message id.
	 \param wParam 32 bits value, specific to the message.
	 \param lParam 32 bits value, specific to the message.
	 \return The result of the processing, which is dependent on the type of message.
	 */
	static LRESULT CALLBACK ooDispatcher(
		HWND hWnd,
		UINT uMsg,
		WPARAM wParam,
		LPARAM lParam );
};
